<template>
	<ul>
		<li v-for="(item, index) in arr" :key="index">
			{{ item }}
			<button @click="arr.splice(index, 1)">删除</button>
		</li>
	</ul>
	<button @click="add">生成</button>
</template>

<script setup>
import { reactive } from 'vue'
// 20以内的整数
const arr = reactive([1, 5, 1])
const add = () => {
	arr.push(Math.floor(Math.random() * 20))
}
</script>

<style scoped>
	
</style>